package com.wing.purchase.controller;


import com.fasterxml.jackson.core.JsonProcessingException;
import com.wing.common.utils.JsonResult;
import com.wing.purchase.entity.request.PurchaseCreateDtoRequest;
import com.wing.purchase.entity.request.PurchaseCreateRequest;
import com.wing.purchase.service.PurchaseService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 畅捷通-往来单位管理
 *
 * @author xiayang
 */
@Validated
@Api(value = "畅捷通-采购管理相关", tags = "#/chanjet/purchaseCjt")
@RestController("PurchaseController")
@RequestMapping("purchaseCjt/admin/purchaseCjt")
@RequiredArgsConstructor
public class PurchaseController {

    @Resource
    PurchaseService purchaseService;

    /**
     * 保存采购入库单
     */
    @ApiOperation(value = "保存采购入库单", notes = "保存")
    @PostMapping("/syncAddPurchaseWork")
    public JsonResult syncAddPurchaseWork(@RequestBody PurchaseCreateDtoRequest purchaseCreateRequest) {
        return JsonResult.success(purchaseService.syncAddPurchaseWork(purchaseCreateRequest));
    }





}
